﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WTwitter.ViewModel {
	/// <summary>
	/// 「閉じる」の概念があるViewModel
	/// </summary>
	abstract public class ClosableViewModelBase : ViewModelBase {
		/// <summary>
		/// コンストラクタ
		/// </summary>
		/// <param name="displayName">ビューでの表示名</param>
		public ClosableViewModelBase(string displayName)
			: base(displayName) {
		}

		/// <summary>
		/// Close要求
		/// </summary>
		public event EventHandler RequestClose;

		/// <summary>
		/// このViewModelを閉じる
		/// </summary>
		public void Close() {
			if (RequestClose != null) {
				RequestClose(this, EventArgs.Empty);
			}
		}
	}
}
